package cn.iocoder.yudao.module.security.dal.mysql.risk;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.security.dal.dataobject.risk.SecurityRiskDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.security.controller.admin.risk.vo.*;

/**
 * 风险分析 Mapper
 *
 * @author cai
 */
@Mapper
public interface SecurityRiskMapper extends BaseMapperX<SecurityRiskDO> {

    default PageResult<SecurityRiskDO> selectPage(SecurityRiskPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SecurityRiskDO>()
                .likeIfPresent(SecurityRiskDO::getRiskName, reqVO.getRiskName())
                .eqIfPresent(SecurityRiskDO::getIpAddress, reqVO.getIpAddress())
                .betweenIfPresent(SecurityRiskDO::getRiskTime, reqVO.getRiskTime())
                .eqIfPresent(SecurityRiskDO::getRiskLevel, reqVO.getRiskLevel())
                .eqIfPresent(SecurityRiskDO::getRiskDesc, reqVO.getRiskDesc())
                .eqIfPresent(SecurityRiskDO::getRiskDetail, reqVO.getRiskDetail())
                .betweenIfPresent(SecurityRiskDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SecurityRiskDO::getId));
    }

}